class CommentPageMixin {
  /**
   * @description 解析请求数据
   * @author songs
   * @date 2019-07-12
   * @param {*} pageInfo
   * @param {*} filtersArg
   * @param {*} sorter
   * @memberof managementUser
   */
  revBaseQueryState = (queryData = {}) => {
    const {
      searchForm,
      tableData: { pagination = {} },
    } = this.props;
    const { current = 1, pageSize = 10 } = pagination;
    return JSON.parse(
      JSON.stringify({
        ...searchForm,
        current,
        pageSize,
        ...queryData,
      }),
    );
  };

  /**
   * @description 搜索表单搜索绑定事件
   * @author songs
   * @date 2019-07-10
   * @param {object} formData
   * @memberof managementUser
   */
  actionSearch = async (formData, reaclData, isClear, uploadType, queryType) => {
    const { dispatch } = this.props;
    const queryData = this.revBaseQueryState(formData);
    await dispatch({
      type: uploadType,
      payload: { isClear, data: formData },
    });

    const res = await dispatch({
      type: queryType,
      payload: queryData,
    });
  };
}

export default CommentPageMixin;
